package com.fr.chart.core;

import com.fr.base.background.Background;
import com.fr.base.core.json.JSONException;
import com.fr.base.core.json.JSONObject;
import com.fr.base.xml.XMLPrintWriter;
import com.fr.base.xml.XMLableReader;
import com.fr.chart.GeneralInfo;
import com.fr.chart.base.equals.Equals;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Shape;

public abstract class GeneralGlyph
  implements Glyph
{
  private static final long serialVersionUID = 3766322098887326831L;
  private GeneralInfo info = new GeneralInfo();

  public void setInfo(GeneralInfo paramGeneralInfo)
  {
    this.info = paramGeneralInfo;
  }

  public GeneralInfo getInfo()
  {
    return this.info;
  }

  public Background getBackground()
  {
    return getInfo().getBackground();
  }

  public void setBackground(Background paramBackground)
  {
    getInfo().setBackground(paramBackground);
  }

  public Shadow getShadow()
  {
    return getInfo().getShadow();
  }

  public void setShadow(Shadow paramShadow)
  {
    getInfo().setShadow(paramShadow);
  }

  public int getBorderStyle()
  {
    return getInfo().getBorderStyle();
  }

  public void setBorderStyle(int paramInt)
  {
    getInfo().setBorderStyle(paramInt);
  }

  public Color getBorderColor()
  {
    return getInfo().getBorderColor();
  }

  public void setBorderColor(Color paramColor)
  {
    getInfo().setBorderColor(paramColor);
  }

  public boolean isRoundBorder()
  {
    return getInfo().isRoundBorder();
  }

  public void setRoundBorder(boolean paramBoolean)
  {
    getInfo().setRoundBorder(paramBoolean);
  }

  public float getAlpha()
  {
    return getInfo().getAlpha();
  }

  public void setAlpha(float paramFloat)
  {
    getInfo().setAlpha(paramFloat);
  }

  public abstract Shape getOutline4Fill();

  public void draw(Graphics paramGraphics)
  {
    this.info.paint(paramGraphics, getOutline4Fill());
  }

  public boolean equals(Object paramObject)
  {
    if (!(paramObject instanceof GeneralGlyph))
      return false;
    GeneralGlyph localGeneralGlyph = (GeneralGlyph)paramObject;
    return (Equals.equals(localGeneralGlyph.getInfo(), getInfo()));
  }

  public void readXML(XMLableReader paramXMLableReader)
  {
    if (paramXMLableReader.isChildNode())
    {
      String str = paramXMLableReader.getTagName();
      if ("GI".equals(str))
        this.info = ((GeneralInfo)paramXMLableReader.readXMLObject(new GeneralInfo()));
    }
  }

  public void writeXML(XMLPrintWriter paramXMLPrintWriter)
  {
    if (this.info != null)
      this.info.writeXML(paramXMLPrintWriter);
  }

  public Object clone()
    throws CloneNotSupportedException
  {
    return super.clone();
  }

  public JSONObject toJSONObject()
    throws JSONException
  {
    JSONObject localJSONObject = new JSONObject();
    if (this.info != null)
      localJSONObject.put("info", this.info.toJSONObject());
    return localJSONObject;
  }
}